The present disclosure relates to debugging techniques and, more particularly, relates to techniques for setting stack pattern breakpoints in COBOL.
The ability to stop a running program based on a condition is a powerful debugging technique that enables users to automatically detect a program state and start investigation at that point. One particularly useful class of conditional breakpoints is the ability to specify and detect a stack pattern. For example, when a particular call path is executed, the program stops at a particular line where the breakpoint is set.
However, some programming languages, such as COBOL (common business-oriented language), cannot easily accommodate stack pattern breakpoints. For example, COBOL paragraphs (i.e., common logical units of execution) are not implemented as stack frames. Consequently, stack pattern breakpoints cannot operate on the paragraphs.
Current COBOL developers utilize manual techniques for simulating stack pattern breakpoints in COBOL programs. In particular, COBOL developers need to anticipate a call path and set line breakpoints at the beginning of each paragraph of the program source code. The developers need to modify the program source code to monitor the current flow by introducing local variables that capture the current state of the program source code. However, this process is tedious, changes the logic of the program, and can introduce bugs in the program if the added debug code is implemented improperly or if the additional local variables are left in the program source code.